#include<bits/stdc++.h>
using namespace std;
#define int long long
const int maxn = 2e5 + 5;
int a[maxn], t[maxn];
signed main(){
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    cin.tie(0);cout.tie(0);
    int n;cin >> n;
    int Max = 0;
    for(int i = 1;i <= n;i ++){
        cin >> a[i];
        Max = max(Max, a[i]);
    }
    sort(a + 1, a + 1 + n);
    if(Max <= 2){
        int temp = lower_bound(a + 1,a + 1 + n, 2) - a;
        // cout << temp << endl;
        cout << n - min(n - temp + 1, temp - 1) << endl;
        return 0;
    }
    for(int i = 1;i <= n;i ++){
        for(int j = 1;j <= n;j ++){
            if(a[j] >= a[i] || i == j || t[j])continue;
            t[j] = 1;
            // cout << j << ' ';
            break;
        }
    }
    // cout << endl;
    int ans = n;
    for(int i = 1;i <= n;i ++)ans -= t[i];
    cout << ans << endl;
}